package com.nchuAo.controller;

import java.util.List;
import com.nchuAo.util.Response;
import com.nchuAo.entity.Student;
import com.nchuAo.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/student")
public class StudentController {
	@Autowired
	private StudentService studentService;
	@GetMapping("/list")
	public Response findAll(){
		List<Student> list = studentService.list();
		return Response.ok().data("students",list);
	}
}
